package com.rocsun.dubbo.controller;

import com.rocsun.dubbo.CommonService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * class:ConsumerController create by @author gyxhp in 2023/4/15 23:28
 */
@RestController
@RequestMapping(value = "/dubbo")
public class ConsumerController {

    /**
     * 此处为通过dubbo远程调用，而非注入
     */
    @DubboReference
    private CommonService commonService;

    @GetMapping("/sayHello")
    public void sayHello(){
        commonService.sayHello();
    }

}
